<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>M-CLUD平台登录</title>
<script type="text/javascript" src="/static/app/cripts/base.js"></script>
<link href="/static/app/css/login.css" rel="stylesheet" type="text/css" />
<link href="/static/app/css/common_1.css" rel="stylesheet" type="text/css" />
<link href="/static/app/css/layx.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="/static/layui/css/layui.css">
<style type="text/css">
	.ceyan img{
		width: 304px;
		border-radius: 6px;
		height: 54px;
		border:1px solid #ccc;
		cursor: pointer;
	}
	.tit_1, .tit_2{
		letter-spacing: 3px;
	}
</style>
</head>
<body>
<div class="head_bg head_posi" id="header"></div>

<div class="main">
    <div class="log_tit">
        <br/><br/>
        <span class="tit_1">MITHRIDATE</span><br />
        <span class="tit_2">LOGIN</span>
    </div>
</div>

<div class="main pb_50">
	<div id="normalLogin">
        <br/><br/>
	    <table class="log_tab mt__10" border="0" cellspacing="0" cellpadding="0">
	      <tr>
	        <td class="w_303">
	            <span class="input" id="telBox">
	            	<span class="icon icon_bg tel_icon"></span>
	            	<input type="text" id="username" placeholder="请输入管理员账号"/>
	            </span>
	        </td>
	      </tr>
	      <tr>
	        <td>
	            <span class="input" id="passBox">
	            	<span class="icon icon_bg pass_icon"></span>
	            	<input type="password" id="password" placeholder="请输入登录密码" />
	            </span>
	        </td>
	      </tr>
	      <tr>
	        <td>
	            <span class="input" id="passBox">
	            	<span class="icon icon_bg pass_icon"></span>
	            	<input type="text" id="captcha" name="captcha" placeholder="验证码" />
	            </span>
	        </td>
	      </tr>
	      <tr>
	        <td class="ceyan">
	            <img src="{:captcha_src()}" onClick="this.src=this.src+'?'+Math.random();" alt="captcha" />
	        </td>
	      </tr>

	      <tr>
	        <td>
	            <a class="btn log_btn" onclick="postBtn()" >立即登录</a>
	        </td>
	      </tr>
	    </table>
    </div>
</div>
<script type="text/javascript" src="/static/app/cripts/jquery.js"></script>
<script src="/static/layui/layui.js"></script>
<script type="text/javascript">
	layui.use(['element', 'form', 'layedit','upload'], function () {
        var form = layui.form;
        var $ = layui.jquery,upload = layui.upload;
    })

	function postBtn(e){
		console.log(111)
		var username = $("#username").val();
		var password = $("#password").val();
		var captcha = $("#captcha").val();
		if(username == ''){
			layer.msg('请输入手机号码',{icon:5, anim: 6, time:1000, shade: [0.2, '#000']});
		    return true;
		}

		if(password == ''){
			layer.msg('请输入登录密码',{icon:5, anim: 6, time:1000, shade: [0.2, '#000']});
		    return true;
		}

		$.post('/admin/login/login', {username:username, password:password, captcha:captcha}, function(res){
	        if(res.code == 0){
	            layer.msg(res.message,{icon:1, time:1000, shade: [0.2, '#000']});
                setTimeout(function(){
                    window.location.href=res.data.url;
                },1000);
	        }else{
	            layer.msg(res.message, {icon:5, anim: 6, time:1000, shade: [0.2, '#000']});
	        }
	    },'json');
	}
</script>

</body>
</html>
